﻿using aerthe.BL.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace aerthe.BL
{
    public class MenuFactory
    {
        public enum MenuType
        {
            MainMenu,
            EmployeeMenu,
            EmployeeAddMenu
        }
         
        public Menu GetMenu(MenuType type)
        {
            switch (type)
            {
                case MenuType.MainMenu:
                    return GetMainMenu();
                case MenuType.EmployeeMenu:
                    return GetEmployeeMenu();
                case MenuType.EmployeeAddMenu:
                    return GetEmployeeAddMenu();
                default:
                    break;
            }
            return null;
        }

        private Menu GetMainMenu()
        {
            return new Menu()
            {
                Name = "Menu główne",
                MenuItems = new[]
                {
                    new MenuItem
                    {
                        ItemName = "Zadanie 1",
                        ItemKey = '1',
                        Task = new BTask1()
                    },
                    new MenuItem
                    {
                        ItemName = "Zadanie 2",
                        ItemKey = '2',
                        Task = new BTask2()
                    },
                    new MenuItem
                    {
                        ItemName = "Zadanie 3",
                        ItemKey = '3',
                        Task = new BTask3()
                    },
                    new MenuItem
                    {
                        ItemName = "Zadanie 4",
                        ItemKey = '4',
                        Task = new BTask4()
                    },
                    new MenuItem
                    {
                        ItemName = "Zadanie 5",
                        ItemKey = '5',
                        Task = new BTask5()
                    },
                    new MenuItem
                    {
                        ItemName = "Wyjście",
                        ItemKey = 'Q',
                        Task = new QuitTask()
                    }
                 }
            };
        }

        private Menu GetEmployeeMenu()
        {
            return new Menu()
            {
                Name = "Zarządzanie pracownikami",
                MenuItems = new[]
                {
                    new MenuItem
                    {
                        ItemName = "Lista",
                        ItemKey = '1',
                        Task = new EmployeeList()
                    },
                    new MenuItem
                    {
                        ItemName = "Dodaj nowego pracownika",
                        ItemKey = '2',
                        Task = new EmployeeAdd()
                    },
                    new MenuItem
                    {
                        ItemName = "Wyjście",
                        ItemKey = 'Q',
                        Task = new QuitTask()
                    }

                 }
            };
        }

        private Menu GetEmployeeAddMenu()
        {
            return new Menu()
            {
                Name = "Dodawanie pracowników",
                MenuItems = new[]
                {
                    new MenuItem
                    {
                        ItemName = "Dodawanie pracowników sp 1",
                        ItemKey = '1',
                        Task = null
                    },
                    new MenuItem
                    {
                        ItemName = "Dodawanie pracowników sp 2",
                        ItemKey = '2',
                        Task = null
                    },
                    new MenuItem
                    {
                        ItemName = "Dodawanie pracowników sp 3",
                        ItemKey = '3',
                        Task = null
                    },
                    new MenuItem
                    {
                        ItemName = "Wyjście",
                        ItemKey = 'Q',
                        Task = new QuitTask()
                    }

                 }
            };
        }
    }
}